public class Queue{
	public class Node{
		Object data;
		Node next;
		public Node(Object data){
			this.data=data;
		}
	}
	Node first,last;
	public void enqueue(Object data){
		if(first==null){
			last = new Node(data);
			first = last;
		}else{
			last = new Node(data);
			last=last.next;
		}
	}
	public Object dequeue(){
		if(first!=null){
			Object item = first.data;
			first = first.next;
			return item;
		}
		return null;
	}
}
